<template>
    <div class="rightContainer">
        <div class="s1">
            <containerBox :title="'预警时间'">
                <div class="imageBox">
                    <div v-for="item,index in times" class="time" :key="index">
                        {{item}}
                    </div>
                </div>
            </containerBox>
        </div>

        <div class="s2">
            <containerBox :title="'系统介绍'">
                <introductionView />
            </containerBox>
        </div>

        <div class="s3">
            <containerBox :title="'本月报警数据'">
                <pieDataView :mapMonth="mapMonth" />
            </containerBox>
        </div>
    </div>
</template>

<script>
import containerBox from '../container-box/index.vue'
import introductionView from './introduction/index.vue'
import pieDataView from './pieData/index.vue'
export default {
    components: {
        containerBox, introductionView, pieDataView
    },
    data() {
        return {
            times: [],
        }
    },
    props: ['mapMonth'],
    methods: {
        initTime() {
            this.times = []
            let current = []
            let timeString = new Date().toLocaleTimeString();
            timeString.split(':').forEach(item=>{
                current.push(item+"")    
            })
            this.times = current;
        },
    },
    mounted() {
        setInterval(this.initTime, 1000)
    },
}
</script>

<style lang="scss" scoped>
.rightContainer {
    width: 450px;
    height: 95%;
    margin: 10px 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .s1 {
        height: 220px;
        width: 100%;
            .imageBox {
                height: calc(100% - 28px);
                width: calc(100% - 38px);
                
                background: url("../../../../assets/img/otto/time.png") no-repeat 0px 0px;
                background-size: 100% 100%;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .time {
                    font-size: 60px;
                    font-weight: bold;
                    width: 106px;
                    text-align:center;
                    background: linear-gradient(180deg, #ffffff 16%, #26ABE1 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }
        }
        
    }

    .s2 {
        height: 275px;
        width: 100%;
    }

    .s3 {
        height: 406px;
        width: 100%;
    }

    

}
</style>

